home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / V XML / VXML.EXE / {app} / samples / selectCourse.xsl < prev   
Encoding:
Extensible Markup Language  |  2002-01-11  |  3.1 KB  |  71 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  3.     xmlns:rs="urn:schemas-microsoft-com:rowset"  
  4.     xmlns:z="#RowsetSchema">
  5.       <xsl:output method="html"/>     
  6.         <xsl:template match = "/">
  7.         
  8.         <p>Here are the courses the selected term. To register for a course please click the 'View Sections' link. You will then be presented with a list of available sections for this course, and you will have the opportunity to add this course to your schedule.</p> 
  9.          <table width="100%"> 
  10.                 <tr> 
  11.                     <td bgcolor="black" width="10%">
  12.                         <font color="white"><center><b>Course Number</b></center></font>
  13.                     </td> 
  14.                     <td bgcolor="black" width="">
  15.                         <font color="white"><center><b>Faculty Name</b></center></font>
  16.                     </td>
  17.                     <td bgcolor="black" width="20%">
  18.                         <font color="black"><center><b>
  19.                             .                        
  20.                         </b></center></font>
  21.                     </td> 
  22.                  </tr>
  23.                     <xsl:apply-templates select = "//rs:data"/>
  24.                 <tr>
  25.                     <td colspan="3" bgcolor="black">
  26.                         <font color="black">.</font>
  27.                     </td>
  28.                 </tr>
  29.                 </table> 
  30.         </xsl:template>
  31.  
  32.         <xsl:template match = "//rs:data">
  33.                 <xsl:for-each select="z:row">
  34.                 <xsl:choose>
  35.                    <xsl:when test="position() mod 2 = 1">
  36.                          <tr> 
  37.                             <td bgcolor="white" width="20%" align="center"><xsl:text></xsl:text>
  38.                                 <xsl:value-of select="@COURSE"/>
  39.                             </td>
  40.                             <td bgcolor="white" width="50%" align="LEFT"><xsl:text></xsl:text>
  41.                                 <xsl:value-of select="@FACULTY"/>
  42.                             </td>
  43.                             <td bgcolor="white" width="30%" align="center">
  44.                             <a>
  45.                                 <xsl:attribute name="href">ViewSections.asp?ABBREVIATION=<xsl:value-of select="@ABREVIATION"/>&LONGNAME=<xsl:value-of select="translate(@LONGNAME, ' ', '+')"/>&DYEAR=<xsl:value-of select="@DYEAR"/>&strRealTerm=<xsl:value-of select="@strRealTerm"/>&COURSE=<xsl:value-of select="@COURSE"/>&DEPARTMENT=<xsl:value-of select="@DEPARTMENT"/>&NAME=<xsl:value-of select="translate(@NAME, ' ', '+')"/></xsl:attribute>
  46.                                 View Sections
  47.                             </a>
  48.                             </td>
  49.                         </tr>
  50.                     </xsl:when>
  51.                        <xsl:otherwise>
  52.                          <tr> 
  53.                             <td bgcolor="#E2E2E2" width="" align="center"><xsl:text></xsl:text>
  54.                                 <xsl:value-of select="@COURSE"/>
  55.                             </td>
  56.                             <td bgcolor="#E2E2E2" width="" align="LEFT"><xsl:text></xsl:text>
  57.                                 <xsl:value-of select="@FACULTY"/>
  58.                             </td>
  59.                             <td bgcolor="#E2E2E2" width="" align="center">
  60.                             <a>
  61.                                 <xsl:attribute name="href">ViewSections.asp?ABBREVIATION=<xsl:value-of select="@ABREVIATION"/>&LONGNAME=<xsl:value-of select="translate(@LONGNAME, ' ', '+')"/>&DYEAR=<xsl:value-of select="@DYEAR"/>&strRealTerm=<xsl:value-of select="@strRealTerm"/>&COURSE=<xsl:value-of select="@COURSE"/>&DEPARTMENT=<xsl:value-of select="@DEPARTMENT"/>&NAME=<xsl:value-of select="translate(@NAME, ' ', '+')"/></xsl:attribute>
  62.                                 View Sections
  63.                             </a>
  64.                                 </td>
  65.                         </tr>
  66.                        </xsl:otherwise>
  67.                 </xsl:choose>
  68.                 </xsl:for-each>         
  69.         </xsl:template>
  70. </xsl:stylesheet>
  71.